package com.euond.permission.entities;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.euond.common.core.entities.BaseEntity;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * Created by Daniel on 17/06/2017.
 * User sums of roles permission and user privilege.
 */
@Getter
@Setter
@TableName(value = "sys_user_permission")
public class UserPermission extends BaseEntity {
    /**
     * 租赁公司ID
     */
    private Long companyId;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 用户登录名
     */
    @TableField(exist = false)
    private String loginName;

    /**
     * 用户名
     */
    @TableField(exist = false)
    private String username;

    /**
     * 资源ID
     */
    private Long resourceId;

    /**
     * URL
     */
    @TableField(exist = false)
    private String url;

    /**
     * 资源名
     */
    @TableField(exist = false)
    private String resourceName;

    /**
     * 是否菜单项
     */
    @TableField(exist = false)
    private Integer resourceIfMenu;

    /**
     * 资源状态
     */
    @TableField(exist = false)
    private Integer resourceStatus;

    /**
     * 用户ID
     */
    @TableField(exist = false)
    private List<Long> userIds;


    /**
     * 用户所有角色权限之和
     */
    @NotNull
    private Integer rolesVal;

    /**
     * 特殊增加权限
     */
    @NotNull
    private Integer addVal;

    /**
     * 特殊减少权限
     */
    @NotNull
    private  Integer subVal;



}
